package com.sourcestream.whileaway;

import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;

public class ScreenService extends Service
{
    /**
     * Registers the "screen off" receiver. For some reason, this intent cannot be registered in the Android manifest
     * file so we have to do that from a service.
     */
    @Override
    public void onCreate()
    {
        super.onCreate();

        // register receiver that handles screen on and screen off logic
        IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
        BroadcastReceiver mReceiver = new ScreenOffReceiver();
        registerReceiver(mReceiver, filter);
    }

    public IBinder onBind(Intent intent)
    {
        return null;
    }
}
